

public class Solution {
	boolean duplicate(int numbers[],int length ) {
       for(int i =0;i<length-1;i++){
    	   if(numbers[i]==i) continue;
    	   else{
    		   if(numbers[numbers[i]]==numbers[i]){
    		   }else{
    			   int t =numbers[i];
    			   numbers[i]=numbers[numbers[i]];
    			   numbers[t]=t;
    			   i--;
    		   }
    	   }
       }
		for(int i=0;i<length;i++)
			System.out.println(numbers[i]+"  ");
		return false;
	}
	public static void main(String[] args) {
		new Solution().duplicate(new int[]{2,1,3,1,4}, 5);
	}
}
